#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author: 高建平
# @description: 
#

from datetime import date
from typing import Union
from app.support import datetime_util
from pydantic import BaseModel, Field,NaiveDatetime
from app.support.decorator import decorator_repr
from app.models.page import Page


@decorator_repr
class ProjectSaleStrategyBase(BaseModel):
    id: Union[int,None] = Field(None, description='id')
    subProjectCode: Union[str,None] = Field(..., description='子项目')
    saleStrategyCode : Union[int,None] = Field(..., description='销售策略 0:首发项目;1:主推项目;2:集团机动项目')
    regionCode: Union[str,None] = Field(None,description='大区编号')
    divisionCode: Union[str,None]  = Field(None, description='事业部编号')
    dockingDate : Union[date,None]  = Field(None,description='对接日期')
    startDate : Union[date,None] = Field(..., description='开始日期')
    endDate : Union[date,None] = Field(..., description='结束日期')
    firstLaunchStatus: Union[int,None] = Field(None, description='首发结果 0:首发途中;1:首发期间中止;2:暂停，调整模式;3:未成功首发;4:成功首发')
    firstLaunchSuccessDate : Union[date,None] = Field(None, description='首发成功日期')
    remark: Union[str,None]  = Field(None, description='备注')
    

@decorator_repr
class ProjectSaleStrategyReq(ProjectSaleStrategyBase):
    salePolicyDocIdList : list[int] = Field(None,alias='salePolicyDocIdList', description='销售政策ID')
    
    
@decorator_repr
class ProjectSaleStrategyQueryReq(Page):
    id: Union[int,None] = Field(None, description='id')
    subProjectCode: Union[str,None]  = Field(None, description='子项目')
    saleStrategyCode : Union[int,None] = Field(None, description='销售策略 0:首发项目;1:主推项目;2:集团机动项目')
    regionCodeList: Union[list[str],None] = Field(None, description='大区编号')
    divisionCodeList:  Union[list[str],None]  = Field(None, description='事业部编号')
    
   
@decorator_repr 
class ProjectSaleStrategyResp(ProjectSaleStrategyBase):
    projectId: Union[str,None]  = Field(None, description='项目ID')
    projectName: Union[str,None]  = Field(None, description='项目名称')
    subProjectName: Union[str,None]  = Field(None, description='子项目名称')
    subProjectType: Union[str,None]  = Field(None, description='子项目模式')
    subProjectTypeName: Union[str,None]  = Field(None, description='子项目模式名称')
    createUserName: Union[str,None]  = Field(None, description='创建者名字')
    createTime:  Union[str,None]  = Field(None, description='创建时间' ,examples=['2023-08-31 11:04:09'])
    updateUserName: Union[str,None]  = Field(None, description='更新者名字')
    updateTime: Union[str,None]  = Field(None, description='更新时间',examples=['2023-08-31 11:04:09'])

    
    